# Group Social Links
You can add various social links such as facebook, twitter, website, blog link, etc. related to the event.

| Parameter | Description | Type | Required |
|:----------|-------------|------|----------|
| `name`  | Name of the Social Link | string | **yes** |
| `link` | Url of the Social Link | string | **yes** |

## Social Links Post Collection [/v1/social-links{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### Create Social Link [POST]
Create a new social link using event_id.

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "relationships":{
                  "event":{
                    "data":{
                      "type":"event",
                      "id":"1"
                    }
                  }
                },
                "attributes": {
                  "name": "Facebook Url",
                  "link": "http://facebook.com/facebook",
                  "identifier": "example"
                },
                "type": "social-link"
              }
            }

+ Response 201 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/social-links/1/relationships/event",
                  "related": "/v1/social-links/1/event"
                }
              }
            },
            "attributes": {
              "link": "http://facebook.com/facebook",
              "deleted-at": null,
              "name": "Facebook Url",
              "identifier": "example"
            },
            "type": "social-link",
            "id": "1",
            "links": {
              "self": "/v1/social-links/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/social-links/1"
          }
        }

## Social Links Get Collection [/v1/events/{event_identifier}/social-links{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + event_identifier: 1 (string) - identifier or event id of the event. (b8324ae2 is an example of identifier)
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List All Social Links under an Event [GET]
Get a list of Social Links.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "count": 1
          },
          "data": [
            {
              "relationships": {
                "event": {
                  "links": {
                    "self": "/v1/social-links/1/relationships/event",
                    "related": "/v1/social-links/1/event"
                  }
                }
              },
              "attributes": {
                "link": "http://facebook.com/facebook",
                "deleted-at": null,
                "name": "Facebook Url",
                "identifier": "example"
              },
              "type": "social-link",
              "id": "1",
              "links": {
                "self": "/v1/social-links/1"
              }
            }
          ],
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/events/1/social-links"
          }
        }


## Social Links [/v1/social-links/{link_id}]
+ Parameters
    + link_id: 1 (integer) - ID of the Social Link in the form of an integer

### Social Link Detail [GET]
+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/social-links/1/relationships/event",
                  "related": "/v1/social-links/1/event"
                }
              }
            },
            "attributes": {
              "link": "http://facebook.com/facebook",
              "deleted-at": null,
              "name": "Facebook Url",
              "identifier": "example"
            },
            "type": "social-link",
            "id": "1",
            "links": {
              "self": "/v1/social-links/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/social-links/1"
          }
        }


### Update Social Link [PATCH]
Update a single social link by `id`.

+ `id` (integer) - ID of the record to update **(required)**

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "attributes": {
                  "name": "Facebook Page Url",
                  "link": "http://facebook.com/facebook",
                  "identifier": "example"
                },
                "type": "social-link",
                "id": "1"
              }
            }

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/social-links/1/relationships/event",
                  "related": "/v1/social-links/1/event"
                }
              }
            },
            "attributes": {
              "link": "http://facebook.com/facebook",
              "deleted-at": null,
              "name": "Facebook Page Url",
              "identifier": "example"
            },
            "type": "social-link",
            "id": "1",
            "links": {
              "self": "/v1/social-links/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/social-links/1"
          }
        }

### Delete Social Link [DELETE]
Delete a single social link.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }
